#ifndef __SOMLG__AUDIO__HH__
#define __SOMLG__AUDIO__HH__

#include <stdlib.h>
#include <stdio.h>

#include <AL/al.h>
#include <AL/alc.h>
#include <vorbis/vorbisfile.h>

typedef struct _sound_t{
    ALenum format;
    ALsizei freq;
    ALboolean loop;
    ALuint src, buf[2];
    ALuint buffer_size;
    OggVorbis_File ogg_file;
    char is_streaming;
    char *buffer_data;
} sound_t;

void init_sound();
void close_sound();

sound_t* create_sound_t(const char *file, ALboolean is_looping, 
        ALboolean is_streaming, ALuint buffer_size);
void free_sound_t(sound_t **snd);
void play_sound(sound_t *snd);
void stop_sound(sound_t *snd);
void pause_sound(sound_t *snd);

#endif
